package com.hnx.admin.aurora.api.sys;

import javax.validation.ConstraintValidatorContext;

/*
创建人： 倔强的头发
创建时间：2025/7/5
功能描述:

*/
public interface CaptchaLoginValidator {
    public static final String CAPTCHA_NONE = "验证码不能为空";
    public static final String CAPTCHA_EXPIRE = "验证码已失效";
    public static final String CAPTCHA_ERROR = "验证码不正确";
    boolean isValid(Object value, ConstraintValidatorContext context);
    default void valid(ConstraintValidatorContext context,String msg){
        context.disableDefaultConstraintViolation();
        context.buildConstraintViolationWithTemplate(msg).addConstraintViolation();
    }
}
